package ${package.Controller};


import org.springframework.web.bind.annotation.RequestMapping;

<#if restControllerStyle>
import org.springframework.web.bind.annotation.RestController;
<#else>
import org.springframework.stereotype.Controller;
</#if>
<#if superControllerClassPackage??>
import ${superControllerClassPackage};
</#if>

/**
 * <p>
 * ${table.comment!} 前端控制器
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
<#if restControllerStyle>
@RestController
<#else>
@Controller
</#if>
@RequestMapping("<#if package.ModuleName??>/${package.ModuleName}</#if>/<#if controllerMappingHyphenStyle??>${controllerMappingHyphen}<#else>${table.entityPath}</#if>")
<#if kotlin>
class ${table.controllerName}<#if superControllerClass??> : ${superControllerClass}()</#if>
<#else>
<#if superControllerClass??>
public class ${table.controllerName} extends ${superControllerClass} {

    @Autowired
    IAnswerBasePaperService paperService;

    @RequestMapping("/list")
    @ResponseBody
    public String list(  ){
        List<AnswerBasePaper> list=paperService.list();
        return JSON.toJSONString(list);

    }
    @RequestMapping("/initEditPage")
    @ResponseBody
    public String initEditPage(@RequestParam(value = "id",required = false) Integer id){
        AnswerBasePaper formEntity=paperService.getById(id);
        return JSON.toJSONString(formEntity);

    }
    @RequestMapping("/save")
    @ResponseBody
    public String save(@RequestBody AnswerBasePaper paper ){
        paperService.saveOrUpdate(paper);
        return JSON.toJSONString("success");

    }


<#else>
public class ${table.controllerName} {
</#if>

}
</#if>
